package com.chag.app.biz.dao.gen;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface BizMapper {
    int countByExample(BizCriteria example);

    int deleteByExample(BizCriteria example);

    @Delete({
        "delete from BIZ",
        "where BIZ_ID = #{bizId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer bizId);

    @Insert({
        "insert into BIZ (BIZ_ID, NAME, ",
        "PASSWORD, PHONE, ",
        "EMAIL, REG_TIME)",
        "values (#{bizId,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, ",
        "#{password,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, ",
        "#{email,jdbcType=VARCHAR}, #{regTime,jdbcType=TIMESTAMP})"
    })
    int insert(Biz record);

    int insertSelective(Biz record);

    List<Biz> selectByExample(BizCriteria example);

    @Select({
        "select",
        "BIZ_ID, NAME, PASSWORD, PHONE, EMAIL, REG_TIME",
        "from BIZ",
        "where BIZ_ID = #{bizId,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    Biz selectByPrimaryKey(Integer bizId);

    int updateByExampleSelective(@Param("record") Biz record, @Param("example") BizCriteria example);

    int updateByExample(@Param("record") Biz record, @Param("example") BizCriteria example);

    int updateByPrimaryKeySelective(Biz record);

    @Update({
        "update BIZ",
        "set NAME = #{name,jdbcType=VARCHAR},",
          "PASSWORD = #{password,jdbcType=VARCHAR},",
          "PHONE = #{phone,jdbcType=VARCHAR},",
          "EMAIL = #{email,jdbcType=VARCHAR},",
          "REG_TIME = #{regTime,jdbcType=TIMESTAMP}",
        "where BIZ_ID = #{bizId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Biz record);
}